// string
const zhang = "zhang";
const [s1, s2, s3, s4, s5] = zhang;

// array
const array = [1, [2, 3]];
const [a1, [a2, a3], a4 = 4] = array;
console.log(a1, a2, a3, a4);

// obj
const user = {
  name: "zhangsan",
  age: 34,
  city: "beijing",
  weight: 70,
  gender: "male",
};
const {
  age,
  name: realName, // 重命名
  height = 180, // 默认值
  ...rest
} = user;

console.log(age, realName, height, rest);
